#
# NeL Bindings
# Copyright (C) 2010 Naush
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/nel.cmake)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/ConfigureChecks.cmake)

# Force out of source builds.
CHECK_OUT_OF_SOURCE()

# Variables which must be set before PROJECT
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
NL_SETUP_DEFAULT_OPTIONS()

INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${NEL_INCLUDE_PATH})

SET(CMAKE_C_FLAGS "${PLATFORM_CFLAGS}  -DSWIGBUILD" CACHE STRING "" FORCE)
SET(CMAKE_CXX_FLAGS "${PLATFORM_CXXFLAGS} -DSWIGBUILD" CACHE STRING "" FORCE)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(NeL-Bindings CXX C)

IF(REBUILD_NATIVE)
    FIND_PACKAGE(SWIG)
ENDIF(REBUILD_NATIVE)

FIND_PACKAGE(LibXml2 REQUIRED)
IF(WITH_PYTHON)
    FIND_PACKAGE(PythonLibs REQUIRED)
ENDIF(WITH_PYTHON)

IF(WITH_JAVA)
    FIND_PACKAGE(Java REQUIRED)
    FIND_PACKAGE(JNI REQUIRED)
    #FIND_PACKAGE(Maven)
ENDIF(WITH_JAVA)

ADD_SUBDIRECTORY(src)
